<jsp:include page="/views/includes/header.jsp" />
<jsp:useBean id="groupe" type="Models.Groupe" scope="request" />
<jsp:useBean id="module" type="Models.Module" scope="request" />
<jsp:useBean id="notes" type="java.util.ArrayList<Models.Note>" scope="request" />

	<h1>Ajout de notes - <%= groupe.getNom() %> - <%= module.getNom() %></h1>
	<form method="POST" method="<%= getServletContext().getContextPath() %>/notes/add">
		<table>
			<thead>
				<tr><th>Etudiant</th><th>Note</th></tr>
			</thead>
			<tbody>
			<% for (Models.Note n : (java.util.ArrayList<Models.Note>) notes) { %>
				<tr>
					<td><%= n.getEtudiant().getNom()+" "+n.getEtudiant().getPrenom() %></td>
					<td><input type="text" name="<%= n.getEtudiant().getIdEtudiant() %>" value="<%= n.getNote() < 0 ? "" : n.getNote() %>"/></td>
				</tr>
			<% } %>
			</tbody>
		</table>
		<br />
		<input type="hidden" name="id_groupe" value="<%= groupe.getIdGroupe() %>"/>
		<input type="hidden" name="id_module" value="<%= module.getIdModule() %>"/>
		<input type="submit" class="submit" value="Noter" name="note" />
	</form>
	
<jsp:include page="/views/includes/footer.jsp" />